﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GreenArrow;
using System.IO;

namespace Shooter
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length < 1) {
                ShowHelp();
                return;
            }
            string markerName;
            markerName = args[0];
            Arrow arrow;
            if (args.Length == 3 && args[0] == "-dir")
            {
                markerName = args[2];
                arrow = new Arrow(args[1]);
            }
            else {
                arrow = new Arrow(Directory.GetCurrentDirectory() + "/MarkerData");
            }
            if (!arrow.HasMarker(markerName)) {
                System.Console.WriteLine("No such marker: " + markerName);
                return;
            }
            bool result = arrow.Click(markerName);
            if (!result)
            {
                System.Console.WriteLine("Failed to find target");
            }
            else {
                System.Console.WriteLine("Done");
            }
        }
        static void ShowHelp() {
            System.Console.WriteLine("Syntax:");
            System.Console.WriteLine("\tShooter <marker name>");
            System.Console.WriteLine("\tShooter -dir <marker directory> <marker name>");
        }
    }
}
